import { request } from '@/utils'

/**
 * @description: 获取用户列表
 * @param {*}
 * @return {*}
 */
export const getUsers = (params) => {
  return request({
    url: '/users',
    method: 'get',
    params
  });
};

/**
 * @description: 删除用户
 * @param {*} id
 * @return {*}
 */
export const deleteUser = (id) => {
  return request({
    url: `/users/${id}`,
    method: 'delete'
  });
};
/**
 * @description: 新增用户
 * @param {*} data
 * @return {*}
 */
export const addUser = (data) => {
  return request({
    url: '/users',
    method: 'post',
    data
  });
};

/**
 * @description: 更新用户
 * @param {*} id
 * @param {*} data
 * @return {*}
 */
export const updateUser = (id, data) => {
  return request({
    url: `/users/${id}`,
    method: 'put',
    data
  });
};

/**
 * @description: 批量删除用户
 * @param {Array} data
 * @return {*}
 */
export const batchDeleteUser = (data) => {
  return request({
    url: '/users/batch',
    method: 'delete',
    data
  });
};
/**
 * @description: 批量新增用户
 * @param {*} data
 * @return {*}
 */
export const batchAddUser = (data) => {
  return request({
    url: '/users/batch',
    method: 'post',
    data,
  });
};
/**
 * @description: 批量更新用户
 * @param {*} data
 * @return {*}
 */
export const batchUpdateUser = (data) => {
  return request({
    url: '/users/batch',
    method: 'put',
    data
  });
};

